package com.snailcatmall.www.serversocket.netty;

import com.snailcatmall.www.serversocket.netty.heartbeatTools.NettyFromClientHeartbeatDetection;
import com.snailcatmall.www.serversocket.netty.heartbeatTools.NettyFromServerHeartbeatDetection;
import com.snailcatmall.www.serversocket.netty.pipeliNenews.NettyFromClientDataMessages;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;

/**
 * @see NettyChannelInitializer 初始化管道通知
 */
public class NettyChannelInitializer extends ChannelInitializer<SocketChannel>{
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        //心跳检测方法
        ch.pipeline().addLast(new NettyFromClientHeartbeatDetection());
        ch.pipeline().addLast(new NettyFromServerHeartbeatDetection());
        //传输读写管道
        ch.pipeline().addLast(new NettyFromClientDataMessages());
    }

}
